package com.extend_;

public class ExtendsExercise01 {
    public static void main(String[] args) {
        PC pc = new PC("intel", "32", "西数", "华硕");
        pc.PcInfo();
        System.out.println("===============");
        NotePad notePad = new NotePad("amd", "16", "三星", "演示");
        notePad.NotePadInfo();
    }
}

class Computer {
    private String cpu;
    private String ram;
    private String hd;

    public Computer() {
    }

    public Computer(String cpu, String ram, String hd) {
        this.cpu = cpu;
        this.ram = ram;
        this.hd = hd;
    }

    public String getCpu() {
        return cpu;
    }

    public void setCpu(String cpu) {
        this.cpu = cpu;
    }

    public String getRam() {
        return ram;
    }

    public void setRam(String ram) {
        this.ram = ram;
    }

    public String getHd() {
        return hd;
    }

    public void setHd(String hd) {
        this.hd = hd;
    }

    public String getDetails() {
        return "cpu='" + cpu + '\'' +
                ", ram='" + ram + '\'' +
                ", hd='" + hd + '\'' +
                '}';
    }

}

class PC extends Computer {
    String brand;

    public PC() {

    }

    public PC(String cpu, String ram, String hd, String brand) {
        super(cpu, ram, hd);
        this.brand = brand;
    }

    public void PcInfo() {
        System.out.println("PC信息是" + getDetails() + "brand=" + brand);
    }
}

class NotePad extends Computer {
    String color;

    public NotePad() {
    }

    public NotePad(String cpu, String ram, String hd, String color) {
        super(cpu, ram, hd);
        this.color = color;
    }

    public void NotePadInfo() {
        System.out.println("NotePad信息是 " + getDetails() + "color=" + color);
    }
}